// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import loginCom from './components/login/login.vue'
import registCom from './components/regist/regist.vue'
import articleWriteCom from './components/article/articleWrite.vue'
import articleListCom from './components/article/articleList.vue'
import articleContent from './components/article/articleContent.vue'
import aboutMeCom from './components/about/aboutMe.vue'
import frindshipLinkCom from './components/friendshipLink/friendshipLink.vue'
import reward from './components/reward/reward.vue'
import discuss from './components/discuss/discuss.vue'
import document from './components/document/document.vue'
import error from './components/error/error.vue'
import share from './components/share/share.vue'
import markdown from './components/markdown/markdown.vue'
import '../node_modules/bootstrap/dist/css/bootstrap.min.css'
import '../node_modules/font-awesome/css/font-awesome.min.css'
import global from './components/Global.vue'

Vue.prototype.GLOBAL = global

// 注册组件
Vue.use(VueResource)
Vue.use(VueRouter)

const routes = [{path: '/', component: articleListCom},
  {path: '/login', component: loginCom},
  {path: '/regist', component: registCom},
  {path: '/articleWrite', component: articleWriteCom},
  {path: '/articleList', component: articleListCom},
  {path: '/aboutMe', component: aboutMeCom},
  {path: '/friendshipLink', component: frindshipLinkCom},
  {path: '/reward', component: reward},
  {path: '/discuss', component: discuss},
  {path: '/document', component: document},
  {path: '/error', component: error},
  {path: '/share', component: share},
  {path: '/articleContent/:id', component: articleContent},
  {path: '/markdown', component: markdown}]

const router = new VueRouter({
  routes: routes
})

Vue.prototype.Host = '/api'

/* eslint-disable no-new */
new Vue({
  router,
  components: {
    app: App
  },
  render: h => h(App)
}).$mount('#app')
